﻿<%@ Page Title="Cadastro Pessoas" Language="C#" MasterPageFile="~/paginas/MasterPage.master" AutoEventWireup="true"
    CodeFile="Cadastro.aspx.cs" Inherits="paginas_Pessoas_Cadastro" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <h1>
        Cadastro de Pessoas</h1>
    <fieldset>
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
        <div class="input top text">
            <asp:RequiredFieldValidator ID="validaUsuario1" runat="server" ControlToValidate="txtNome"
                ErrorMessage="Nome obrigatório." SetFocusOnError="True" 
                ValidationGroup="Grupo2" Visible="False"></asp:RequiredFieldValidator>            
              <asp:RequiredFieldValidator ID="validaUsuario2" runat="server" ControlToValidate="txtCpf"
                ErrorMessage="CPF obrigatório." SetFocusOnError="True" 
                ValidationGroup="Grupo2" Visible="False"></asp:RequiredFieldValidator>            
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Email inválido."
                ControlToValidate="txtEmail" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                SetFocusOnError="true" Visible="False"></asp:RegularExpressionValidator>            
            <asp:Label Text="Nome" ID="lblNome" AssociatedControlID="txtNome" runat="server" />
            <asp:TextBox ID="txtNome" runat="server" ValidationGroup="Grupo2" />
        </div>
        <%--        <div class="input top text">
            <asp:Label Text="Sobrenome" ID="lblSobrenome" AssociatedControlID="txtSobrenome" runat="server" />
            <asp:TextBox ID="txtSobrenome" runat="server" />
        </div>--%>
        <div class="input top text">                        
            <asp:Label Text="CPF/CNPJ" ID="lblCpf" AssociatedControlID="txtNome" runat="server" />
            <asp:TextBox ID="txtCpf" runat="server" ValidationGroup="Grupo2" />          
              
           <%-- <asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server" Mask="999\.999\.999\-99"
                TargetControlID="txtCpf" ClearMaskOnLostFocus="false" ClearTextOnInvalid= "true">
            </asp:MaskedEditExtender>--%>
        </div>
        <div class="input top text">
            <asp:Label Text="RG" ID="lblRG" AssociatedControlID="txtRG" runat="server" />
            <asp:TextBox ID="txtRG" runat="server" />
        </div>
          <div class="input top text">
            <asp:Label Text="IE" ID="lblIE" AssociatedControlID="txtIE" runat="server" />
            <asp:TextBox ID="txtIE" runat="server" />
        </div>
        <div class="input top text">
            <asp:Label Text="Data Nascimento" ID="lblDataNascimento" AssociatedControlID="txtDataNascimento"
                runat="server" />
            <asp:TextBox ID="txtDataNascimento" runat="server" ValidationGroup="Grupo2" />
            <asp:MaskedEditExtender ID="MaskedEditExtender2" runat="server" Mask="99/99/9999"
                TargetControlID="txtDataNascimento" ClearMaskOnLostFocus="false">
            </asp:MaskedEditExtender>
        </div>
        <div class="input top text">
            <asp:Label Text="Email" ID="lblEmail" AssociatedControlID="txtEmail" runat="server" />
            <asp:TextBox ID="txtEmail" runat="server" ValidationGroup="Grupo2" />
        </div>
        <div class="input top text">
            <asp:Label Text="Cidade" ID="lblCidade" AssociatedControlID="txtCidade" runat="server" />
            <asp:TextBox ID="txtCidade" runat="server" />
        </div>
        <div class="input top text">
            <asp:Label ID="lblbairro" runat="server" Text="Bairro" AssociatedControlID="txtBairro"></asp:Label>
            <asp:TextBox ID="txtBairro" runat="server"></asp:TextBox>
            </div>
            <div class="input top text">
            <asp:Label Text="Endereço" ID="lblEndereco" AssociatedControlID="txtEndereco" runat="server" />
            <asp:TextBox ID="txtEndereco" runat="server" />
        </div>        
        <div class="input top text">
            <asp:Label Text="CEP" ID="lblCep" AssociatedControlID="txtCep" runat="server" />
            <asp:TextBox ID="txtCep" runat="server" ValidationGroup="Grupo2" 
                />
            <asp:MaskedEditExtender ID="MaskedEditExtender3" runat="server" Mask="99999\-999"
                TargetControlID="txtCep" ClearMaskOnLostFocus="false">
            </asp:MaskedEditExtender>
        </div>
        <div class="input top text">
            <asp:Label Text="Estado" ID="lblEstado" AssociatedControlID="ddEstado" runat="server" />
            <asp:DropDownList runat="server" ID="ddEstado" 
                onselectedindexchanged="ddEstado_SelectedIndexChanged">
            </asp:DropDownList>
        </div>
        <div class="input top text">
            <asp:Label Text="Fone Residencial" ID="lblFonePrincipal" AssociatedControlID="txtFonePrincipal"
                runat="server" />
            <asp:TextBox ID="txtFonePrincipal" runat="server" ValidationGroup="Grupo2" 
                />
            <asp:MaskedEditExtender ID="MaskedEditExtender4" runat="server" Mask="(99)9999\.9999"
                TargetControlID="txtFonePrincipal" ClearMaskOnLostFocus="false">
            </asp:MaskedEditExtender>
        </div>
        <div class="input top text">
            <asp:Label Text="Fone Celular" ID="lblFoneCelular" AssociatedControlID="txtFoneCelular"
                runat="server" />
            <asp:TextBox ID="txtFoneCelular" runat="server" ValidationGroup="Grupo2" 
                />
            <asp:MaskedEditExtender ID="MaskedEditExtender5" runat="server" Mask="(99)9999\.9999"
                TargetControlID="txtFoneCelular" ClearMaskOnLostFocus="false">
            </asp:MaskedEditExtender>
        </div>      
        <div class="input top text">
            <asp:Label Text="Sexo" ID="lblSexo" runat="server" />
            <asp:RadioButtonList ID="rblSexo" runat="server" 
                onselectedindexchanged="rblSexo_SelectedIndexChanged">
                <asp:ListItem Text="Masculino" Value="Masculino" />
                <asp:ListItem Text="Feminino" />
            </asp:RadioButtonList>
        </div>
        <div class="input top text">
            <asp:Label Text="Obs." ID="lblObs" AssociatedControlID="txtObs" runat="server" />            
            <asp:TextBox ID="txtObs" runat="server" TextMode="MultiLine" />
        </div>
        <div class="input btn text">        
            <asp:Button ID="btnSalvar" Text="Salvar" runat="server" OnClick="btnSalvar_Click" ValidationGroup="Grupo2" />
            <asp:Button ID="btnCancelar" Text="Cancelar" runat="server" OnClick="btnCancelar_Click" />
            <asp:Button ID="btnExcluir" runat="server" Text="Excluir" OnClick="btnExcluir_Click" OnClientClick="return confirm('Deseja excluir o registro?')"/>           
        </div>
        <hr />
    </fieldset>
</asp:Content>
